package com.lins.storedisk.dao;

import com.lins.storedisk.entity.FileEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.QueryByExampleExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface FileDao extends JpaRepository<FileEntity,Integer>, QueryByExampleExecutor<FileEntity> { //追加继承接口

    FileEntity findByUrlAndFileType(String url,String fileType);

    FileEntity findByIdAndUid(Integer id,Integer uid);

    List<FileEntity> findByUidAndFileNameAndParUrlAndState(Integer uid,String fileName,String parUrl,String state);

    List<FileEntity> findByFileTypeAndUid(String fileType,Integer uid);

    List<FileEntity> findByUidAndParIdAndState(Integer uid,Integer parId,String state);
    List<FileEntity> findByUidAndParUrlAndState(Integer uid,String parUrl,String state);
    List<FileEntity> findByUidAndFileTypeAndFileNameContaining(Integer uid,String fileType,String fileName);


}
